package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiT_shipper_account;

//DAO
public interface T_shipper_accountMapperBase {

	// 根据id查看
	@Select("SELECT * FROM t_shipper_account  WHERE id = #{id}")
	public ApiT_shipper_account findT_shipper_accountById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_shipper_account")
	public List<ApiT_shipper_account> findT_shipper_accounts();

	// 添加
	@Insert("INSERT INTO t_shipper_account (user_id, working_status, money, order_cash, create_time, update_time,bank_card,bank_num,ID_card,health_card,ID_num,reserve_money,balance_date,basic_wage) VALUES (#{user_id}, #{working_status}, #{money}, #{order_cash}, #{create_time}, #{update_time},#{bank_card},#{bank_num},#{ID_card},#{health_card},#{ID_num},#{reserve_money},#{balance_date},#{basic_wage})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_shipper_account(ApiT_shipper_account t_shipper_account);

	// 修改
	@Update("UPDATE t_shipper_account SET user_id = #{user_id}, working_status = #{working_status}, money = #{money}, order_cash = #{order_cash}, create_time = #{create_time}, update_time = #{update_time},bank_card=#{bank_card},bank_num=#{bank_num},ID_card=#{ID_card},health_card=#{health_card},ID_num=#{ID_num},reserve_money=#{reserve_money},balance_date=#{balance_date},basic_wage=#{basic_wage} WHERE id = #{id}")
	public int updateT_shipper_account(ApiT_shipper_account t_shipper_account);

	// 删除
	@Delete("DELETE FROM t_shipper_account  WHERE id = #{id}")
	public int deleteT_shipper_account(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

	// 获取根据user_id
	@Select("SELECT id, user_id, working_status, money, order_cash, create_time, update_time FROM t_shipper_account  WHERE user_id = #{user_id}")
	public List<ApiT_shipper_account> findT_shipper_accountsByUser_id(String user_id);

	// 获取根据working_status
	@Select("SELECT id, user_id, working_status, money, order_cash, create_time, update_time FROM t_shipper_account  WHERE working_status = #{working_status}")
	public List<ApiT_shipper_account> findT_shipper_accountsByWorking_status(String working_status);

}
